package com.ruoyi.lm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lm.mapper.LmActivityMapper;
import com.ruoyi.lm.domain.LmActivity;
import com.ruoyi.lm.service.ILmActivityService;
import com.ruoyi.common.core.text.Convert;

/**
 * 活动Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-02
 */
@Service
public class LmActivityServiceImpl implements ILmActivityService 
{
    @Autowired
    private LmActivityMapper lmActivityMapper;

    /**
     * 查询活动
     * 
     * @param id 活动ID
     * @return 活动
     */
    @Override
    public LmActivity selectLmActivityById(String id)
    {
        return lmActivityMapper.selectLmActivityById(id);
    }

    /**
     * 查询活动列表
     * 
     * @param lmActivity 活动
     * @return 活动
     */
    @Override
    public List<LmActivity> selectLmActivityList(LmActivity lmActivity)
    {
        return lmActivityMapper.selectLmActivityList(lmActivity);
    }

    /**
     * 新增活动
     * 
     * @param lmActivity 活动
     * @return 结果
     */
    @Override
    public int insertLmActivity(LmActivity lmActivity)
    {
        lmActivity.setCreateTime(DateUtils.getNowDate());
        return lmActivityMapper.insertLmActivity(lmActivity);
    }

    /**
     * 修改活动
     * 
     * @param lmActivity 活动
     * @return 结果
     */
    @Override
    public int updateLmActivity(LmActivity lmActivity)
    {
        lmActivity.setUpdateTime(DateUtils.getNowDate());
        return lmActivityMapper.updateLmActivity(lmActivity);
    }

    /**
     * 删除活动对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLmActivityByIds(String ids)
    {
        return lmActivityMapper.deleteLmActivityByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除活动信息
     * 
     * @param id 活动ID
     * @return 结果
     */
    @Override
    public int deleteLmActivityById(String id)
    {
        return lmActivityMapper.deleteLmActivityById(id);
    }
}
